﻿using System;
using System.Diagnostics;
using System.Globalization;
using System.Windows.Data;

namespace ttg_internal.Utilities.UsageVisualizer.Converter
{
    [ValueConversion(typeof(double), typeof(string))]
    internal class PercentStringConverter: IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            Debug.Assert(value is double);
            return ((double)value).ToString("#0.%", CultureInfo.InvariantCulture);
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
